package com.icoolkj.ms.api.auth.feign;

import com.icoolkj.ms.api.auth.bo.UserInfoInTokenBO;
import com.icoolkj.ms.common.core.constant.Auth;
import com.icoolkj.ms.common.core.constant.ServiceNameConstants;
import com.icoolkj.ms.common.core.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author icoolkj
 * @version 1.0
 * @description
 * @createDate 2025/02/09 19:25
 */
@FeignClient(value = ServiceNameConstants.AUTH_SERVICE, contextId = "token")
public interface TokenFeignClient {

    /**
     * 校验token并返回token保存的用户信息
     * @param accessToken accessToken
     * @return token保存的用户信息
     */
    @GetMapping(value = Auth.CHECK_TOKEN_URI)
    ServerResponseEntity<UserInfoInTokenBO> checkToken(@RequestParam("accessToken") String accessToken);
}
